<?php
defined('_JEXEC') or die('Restricted access');
class modPollHelper extends ModuleObject{
	
	function __construct(){
		parent::__construct('mod_poll');
	}
	
	function getPoll($pid){
		$this->_dbo->setQuery("SELECT title FROM polls WHERE id = ".$pid);
		return $this->_dbo->loadResult();
	}
	
	
	function getPollOptions($pid){
		$query = "SELECT `text`,id as voteid FROM poll_data WHERE pollid = $pid";
		$this->_dbo->setQuery($query);
		return $this->_dbo->loadObjectList();
	}
	
}